Skip to content

fix(plot): corner plot survives degenerate (no-dynamic-range) columns#1347

Merged
Jammy2211 merged 1 commit into
mainfrom
bug/corner-degenerate-column-range
Jul 10, 2026
Merged

fix(plot): corner plot survives degenerate (no-dynamic-range) columns#1347
Jammy2211 merged 1 commit into
mainfrom
bug/corner-degenerate-column-range

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Problem

autofit_workspace/scripts/searches/mcmc.py crashes in release.yml's run_smoke_tests job (and Heart's release-fidelity workspace validation) with:

ValueError: It looks like the parameter(s) in column(s) 0, 1, 2 have no dynamic range. Please provide a `range` argument.

Reproduced locally on current main under the release smoke profile (PYAUTO_TEST_MODE=1 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1). The crash is here in the library, not the workspace:

autofit/non_linear/plot/samples_plotters.py:33  corner.corner(...)

corner_cornerpy called corner.corner(...) with no range=. When any column has zero spread — all samples equal, which is expected under reduced-iteration runs and possible for any parameter that converges flat — corner raises rather than plotting. This affects every corner-plotting search (Emcee/Zeus/Nautilus), so the fix belongs in the library.

Fix

Compute an explicit per-column range (_corner_range_from) and pass it to corner.corner. Columns with real spread keep their (min, max); degenerate columns are widened to a small non-zero window centred on the value so the plot still renders. This is not a silent guard — the plot is produced, degenerate columns are a legitimate input.

Verification

  • PYAUTO_TEST_MODE=1 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1 python autofit_workspace/scripts/searches/mcmc.py now exits 0 and writes corner.png (previously crashed).
  • New unit test test_autofit/non_linear/plot/test_samples_plotters.py (degenerate + real-spread columns).
  • pytest test_autofit/non_linear/plot test_autofit/non_linear/samples → 35 passed.

pending-release

…crash

corner_cornerpy called corner.corner without a range=, so any column with
zero spread (all samples equal — reduced-iteration runs like PYAUTO_TEST_MODE=1,
or a parameter converged flat) raised 'no dynamic range' and killed the plot.
Compute an explicit per-column range, widening degenerate columns to a small
non-zero window, so the corner plot always renders. Fixes the searches/mcmc.py
release smoke crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 10, 2026
@Jammy2211 Jammy2211 merged commit 2e33b17 into main Jul 10, 2026
6 checks passed
@Jammy2211 Jammy2211 deleted the bug/corner-degenerate-column-range branch July 10, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant